function getScrollY() {
  var a = 0;
  a = 0;
  if(typeof window.pageYOffset == "number")a = window.pageYOffset;
  else if(document.body && (document.body.scrollLeft || document.body.scrollTop))a = document.body.scrollTop;
  else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))a = document.documentElement.scrollTop;
  return a
}
document.write("<style>.cp{visibility:hidden;display:none;position:absolute;border:solid 0px #CCC;padding:0px;z-index:999;}</style>");
function gett6op6() {
  csBrHt = 0;
  if(typeof window.innerWidth == "number")csBrHt = window.innerHeight;
  else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))csBrHt = document.documentElement.clientHeight;
  else if(document.body && (document.body.clientWidth || document.body.clientHeight))csBrHt = document.body.clientHeight;
  return ctop = csBrHt / 2 - 132 + getScrollY()
}
function getLeft6() {
  var a = 0;
  if(typeof window.innerWidth == "number")a = window.innerWidth;
  else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))a = document.documentElement.clientWidth;
  else if(document.body && (document.body.clientWidth || document.body.clientHeight))a = document.body.clientWidth;
  return cleft = a / 2 - 125
}
var nocol1 = "Очистить", clos1 = "Закрыть", tt6 = "", hm6 = "Выберите цвет";
hm6 += tt6;
function setCCbldID6(a, e) {
  document.getElementById(a).value = e
}
function setCCbldSty6(a, e, b) {
  switch(e) {
    case "bc":
      if(a != "none")document.getElementById(a).style.backgroundColor = b;
      break;
    case "vs":
      document.getElementById(a).style.visibility = b;
      break;
    case "ds":
      document.getElementById(a).style.display = b;
      break;
    case "tp":
      document.getElementById(a).style.top = b;
      break;
    case "lf":
      document.getElementById(a).style.left = b;
      break
  }
}
function putOBJxColor6(a, e, b) {
  if(b != "x") {
    setCCbldID6(a, b);
    setCCbldSty6(e, "bc", b)
  }setCCbldSty6("cp", "vs", "hidden");
  setCCbldSty6("cp", "ds", "none")
}
function showColorGrid3(a, e) {
  var b = new Array("00", "33", "66", "99", "CC", "FF"), g = 0, f = '"' + a + '","' + e + '",""', c = '"' + a + '","' + e + '","x"', d = "";
  d += '<table class="n"><tr>';
  d += "<td colspan='18' class='up'>Выберите цвет авто</td></tr><tr><td colspan='6' align=center><input type='text' size='5' id='example' value='' ></td><td colspan='6' align=center><a href='javascript:onclick=putOBJxColor6(" + 
  f + ")'>" + nocol1 + "</a></td><td colspan='6' align=center><a href='javascript:onclick=putOBJxColor6(" + c + ")'>" + clos1 + "</a></td></tr><tr>";
  f = 1;
  for(o = 0;o < 6;o++) {
    d += "</tr><tr>";
    for(y = 0;y < 6;y++) {
      if(y == 3)d += "</tr><tr>";
      for(x = 0;x < 6;x++) {
        c = "";
        c = b[o] + b[y] + b[x];
        var h = "'" + a + "', '" + e + "','#" + c + "'";
        d += '<td style="background-color:#' + c + ';padding:0px"><a href="javascript:onclick=putOBJxColor6(' + h + ');" onmouseover=javascript:document.getElementById("example").style.backgroundColor="#' + c + '";><div style="width:14px;height:14px;"></div></a></td>';
        g++
      }
    }
  }d += "</tr></table>";
  b = new Array("0", "3", "6", "9", "C", "F");
  g = 0;
  d += '<table class="n"><tr>';
  for(y = f = 0;y < 6;y++)for(x = 0;x < 6;x++) {
    if(f == 18) {
      f = 0;
      d += "</tr><tr>"
    }f++;
    c = b[y] + b[x] + b[y] + b[x] + b[y] + b[x];
    h = "'" + a + "', '" + e + "','#" + c + "'";
    d += '<td style="background-color:#' + c + ';padding:0px"><a href="javascript:onclick=putOBJxColor6(' + h + ');" onmouseover=javascript:document.getElementById("example").style.backgroundColor="#' + c + '";><div style="width:14px;height:14px;"></div></a></td>';
    g++
  }d += "</tr>";
  d += "</table>";
  setCCbldSty6("cp", "tp", "500px");
  document.getElementById("cp").style.top = gett6op6();
  document.getElementById("cp").style.left = getLeft6();
  setCCbldSty6("cp", "vs", "visible");
  setCCbldSty6("cp", "ds", "block");
  document.getElementById("cp").innerHTML = d
}
;